From: Siebrand Mazeland Date: Sat, 22 Jan 2011 14:36:11 +0000 (+0000) Subject: * changed 'searchmenu-new-nocreate' to no longer be ignored and have content. Address... X-Git-Tag: 1.31.0-rc.0~32438 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=3ebd614fc42f6f8f319450eb2ed93eee4458eba9;p=lhc%2Fweb%2Fwiklou.git * changed 'searchmenu-new-nocreate' to no longer be ignored and have content. Addresses bug 26747. * remove trailing whitespace form SpecialSearch.php. --- diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 5188c8f67d..cf173ed5dc 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -103,12 +103,12 @@ class SpecialSearch extends SpecialPage { } # If there's an exact or very near match, jump right there. $t = SearchEngine::getNearMatch( $term ); - + if ( !wfRunHooks( 'SpecialSearchGo', array( &$t, &$term ) ) ) { # Hook requested termination return; } - + if( !is_null( $t ) ) { $wgOut->redirect( $t->getFullURL() ); return; @@ -243,7 +243,7 @@ class SpecialSearch extends SpecialPage { $wgOut->addHTML( $this->formHeader($term, 0, 0)); if( $this->searchAdvanced ) { $wgOut->addHTML( $this->powerSearchBox( $term ) ); - } + } $wgOut->addHTML( '' ); // Empty query -- straight view of search form wfProfileOut( __METHOD__ ); @@ -255,7 +255,7 @@ class SpecialSearch extends SpecialPage { $textMatchesNum = $textMatches ? $textMatches->numRows() : 0; // Total initial query matches (possible false positives) $num = $titleMatchesNum + $textMatchesNum; - + // Get total actual results (after second filtering, if any) $numTitleMatches = $titleMatches && !is_null( $titleMatches->getTotalHits() ) ? $titleMatches->getTotalHits() : $titleMatchesNum; @@ -268,13 +268,13 @@ class SpecialSearch extends SpecialPage { $totalRes += $titleMatches->getTotalHits(); if($textMatches && !is_null( $textMatches->getTotalHits() )) $totalRes += $textMatches->getTotalHits(); - + // show number of results and current offset $wgOut->addHTML( $this->formHeader($term, $num, $totalRes)); if( $this->searchAdvanced ) { $wgOut->addHTML( $this->powerSearchBox( $term ) ); } - + $wgOut->addHtml( Xml::closeElement( 'form' ) ); $wgOut->addHtml( "
" ); @@ -291,7 +291,7 @@ class SpecialSearch extends SpecialPage { wfRunHooks( 'SpecialSearchResults', array( $term, &$titleMatches, &$textMatches ) ); } else { wfRunHooks( 'SpecialSearchNoResults', array( $term ) ); - } + } $wgOut->parserOptions()->setEditSection( false ); if( $titleMatches ) { @@ -332,10 +332,10 @@ class SpecialSearch extends SpecialPage { } wfProfileOut( __METHOD__ ); } - + protected function showCreateLink( $t ) { global $wgOut; - + // show direct page/create link if applicable $messageName = null; if( !is_null($t) ) { @@ -346,7 +346,7 @@ class SpecialSearch extends SpecialPage { } else { $messageName = 'searchmenu-new-nocreate'; } - } + } if( $messageName ) { $wgOut->wrapWikiMsg( "

\n$1

", array( $messageName, wfEscapeWikiText( $t->getPrefixedText() ) ) ); } else { @@ -365,12 +365,12 @@ class SpecialSearch extends SpecialPage { $this->active = 'advanced'; } else { $profiles = $this->getSearchProfiles(); - + foreach( $profiles as $key => $data ) { if ( $this->namespaces == $data['namespaces'] && $key != 'advanced') $this->active = $key; } - + } # Should advanced UI be used? $this->searchAdvanced = ($this->active === 'advanced'); @@ -467,9 +467,9 @@ class SpecialSearch extends SpecialPage { if( $titleSnippet == '' ) $titleSnippet = null; - + $link_t = clone $t; - + wfRunHooks( 'ShowSearchHitTitle', array( &$link_t, &$titleSnippet, $result, $terms, $this ) ); @@ -777,7 +777,7 @@ class SpecialSearch extends SpecialPage { } $rows = array_values( $rows ); $numRows = count( $rows ); - + // Lays out namespaces in multiple floating two-column tables so they'll // be arranged nicely while still accommodating different screen widths $namespaceTables = ''; @@ -841,11 +841,11 @@ class SpecialSearch extends SpecialPage { Html::hidden( 'fulltext', 'Advanced search' ) . Xml::closeElement( 'fieldset' ); } - + protected function getSearchProfiles() { // Builds list of Search Types (profiles) $nsAllSet = array_keys( SearchEngine::searchableNamespaces() ); - + $profiles = array( 'default' => array( 'message' => 'searchprofile-articles', @@ -880,21 +880,21 @@ class SpecialSearch extends SpecialPage { 'parameters' => array( 'advanced' => 1 ), ) ); - + wfRunHooks( 'SpecialSearchProfiles', array( &$profiles ) ); foreach( $profiles as &$data ) { sort($data['namespaces']); } - + return $profiles; } protected function formHeader( $term, $resultsShown, $totalNum ) { global $wgLang; - + $out = Xml::openElement('div', array( 'class' => 'mw-search-formheader' ) ); - + $bareterm = $term; if( $this->startsWithImage( $term ) ) { // Deletes prefixes @@ -902,7 +902,7 @@ class SpecialSearch extends SpecialPage { } $profiles = $this->getSearchProfiles(); - + // Outputs XML for Search Types $out .= Xml::openElement( 'div', array( 'class' => 'search-types' ) ); $out .= Xml::openElement( 'ul' ); @@ -919,7 +919,7 @@ class SpecialSearch extends SpecialPage { $profile['namespaces'], wfMsg( $profile['message'] ), wfMsg( $profile['tooltip'], $tooltipParam ), - isset( $profile['parameters'] ) ? $profile['parameters'] : array() + isset( $profile['parameters'] ) ? $profile['parameters'] : array() ) ); } @@ -945,17 +945,17 @@ class SpecialSearch extends SpecialPage { Xml::tags( 'ul', null, Xml::tags( 'li', null, $top ) ) ); } - + $out .= Xml::element( 'div', array( 'style' => 'clear:both' ), '', false ); $out .= Xml::closeElement('div'); - + // Adds hidden namespace fields if ( !$this->searchAdvanced ) { foreach( $this->namespaces as $ns ) { $out .= Html::hidden( "ns{$ns}", '1' ); } } - + return $out; } @@ -972,7 +972,7 @@ class SpecialSearch extends SpecialPage { ) ) . "\n"; $out .= Html::hidden( 'fulltext', 'Search' ) . "\n"; $out .= Xml::submitButton( wfMsg( 'searchbutton' ) ) . "\n"; - return $out . $this->didYouMeanHtml; + return $out . $this->didYouMeanHtml; } /** @@ -1005,7 +1005,7 @@ class SpecialSearch extends SpecialPage { 'a', array( 'href' => $st->getLocalURL( $stParams ), - 'title' => $tooltip, + 'title' => $tooltip, 'onmousedown' => 'mwSearchHeaderClick(this);', 'onkeydown' => 'mwSearchHeaderClick(this);'), $label @@ -1027,7 +1027,7 @@ class SpecialSearch extends SpecialPage { } return false; } - + /** * Check if query starts with all: prefix * @@ -1037,7 +1037,7 @@ class SpecialSearch extends SpecialPage { protected function startsWithAll( $term ) { $allkeyword = wfMsgForContent('searchall'); - + $p = explode( ':', $term ); if( count( $p ) > 1 ) { return $p[0] == $allkeyword; @@ -1045,4 +1045,3 @@ class SpecialSearch extends SpecialPage { return false; } } - diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index b396fc5470..c539482774 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1664,7 +1664,7 @@ Note that using the navigation links will reset this column.', 'searchmenu-legend' => 'Search options', 'searchmenu-exists' => "'''There is a page named \"[[:\$1]]\" on this wiki.'''", 'searchmenu-new' => "'''Create the page \"[[:\$1]]\" on this wiki!'''", -'searchmenu-new-nocreate' => '', # do not translate or duplicate this message to other languages +'searchmenu-new-nocreate' => '"$1" is an invalid page name or cannot be created by you.', 'searchhelp-url' => 'Help:Contents', 'searchmenu-prefix' => '[[Special:PrefixIndex/$1|Browse pages with this prefix]]', 'searchmenu-help' => '[[{{MediaWiki:Searchhelp-url}}|{{int:help}}]]?', # do not translate or duplicate this message to other languages diff --git a/maintenance/language/messageTypes.inc b/maintenance/language/messageTypes.inc index 15ee3683c4..541345cd16 100644 --- a/maintenance/language/messageTypes.inc +++ b/maintenance/language/messageTypes.inc @@ -95,7 +95,6 @@ $wgIgnoredMessages = array( 'anonnotice', 'autoblock_whitelist', 'searchmenu-help', - 'searchmenu-new-nocreate', 'googlesearch', 'opensearch-desc', 'exif-make-value',